package com.alks.function.mapper.subcontract;

import com.alks.common.data.dto.SysUserTokenDTO;
import com.alks.entity.data.entity.dispatch.OemLotHead;
import com.alks.entity.data.entity.dispatch.UserOemRelation;
import com.alks.entity.data.entity.dispatch.Vendor;
import com.alks.entity.data.entity.imes.Brand;
import com.alks.entity.data.entity.imes.BrandOemRelation;
import com.alks.entity.data.entity.imes.SysUserSub;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Mapper
public interface SubcontractMapper {

    List<OemLotHead> searchOemLotHead(OemLotHead oemLotHead);

    OemLotHead selectByUuid(OemLotHead oemLotHead);

    Integer complete(OemLotHead oemLotHead);

    Map<String, BigDecimal> summary(OemLotHead oemLotHead);

    int selectPayCfmCount(@Param("companyId") String companyId, @Param("factoryLotNo") String factoryLotNo);

    void updatePrice(OemLotHead oemLotHead);

    void deleteByLotUUID(OemLotHead oemLotHead);

    int selectByFactoryLotNo(OemLotHead oemLotHead);

    void deleteUuid(OemLotHead oemLotHead);

    List<Vendor> oemCombo(String searchKey, List<String> vendorTypes, String companyId);

    List<SysUserSub> selectUserByRoleId(SysUserSub user);

    List<UserOemRelation> selectByUserId(@Param("companyId") String companyId, @Param("userId") Long userId);

    UserOemRelation selectByUserVendor(UserOemRelation userOemRelation);

    int insert(UserOemRelation userOemRelation);

    int deleteVendor(UserOemRelation userOemRelation);

    List<BrandOemRelation> brandOemRelationslist(@Param("companyId") String companyId, @Param("userId") Long userId);

    BrandOemRelation selectBrandByUserVendor(BrandOemRelation userOemRelation);

    int insertBrand(BrandOemRelation userOemRelation);

    int deleteBrand(BrandOemRelation userOemRelation);

    List<Brand> brandComboList( @Param("companyId") String companyId);

    List<Brand> queryBrandList(Brand brand);

    int selectMaxSeqNo(Brand brand);

    int repeatOrNotByName(Brand brand);

    int insertBrands(Brand brand);

    void insertOpLog(@Param("oemLotHead") OemLotHead oemLotHead, @Param("userName") SysUserTokenDTO userName);
}
